testsuite: Don't use return_if_fail()
authorBenjamin Otte <otte@redhat.com>
Sat, 22 Feb 2020 06:35:23 +0000 (07:35 +0100)
committerBenjamin Otte <otte@redhat.com>
Sat, 22 Feb 2020 06:35:23 +0000 (07:35 +0100)
Use assert() instead

testsuite/gtk/treeview.c

index 016f1a8357ca186f53521fd7551c3aebf57a61db..f92f42c7b8fe181cf500a6e81ddf6f2c84590115 100644 (file)
@@ -135,23 +135,23 @@ test_select_collapsed_row (void)
 
   /* Check that the parent is not selected. */
   gtk_tree_path_up (path);
-  g_return_if_fail (gtk_tree_selection_path_is_selected (selection, path) == FALSE);
+  g_assert_false (gtk_tree_selection_path_is_selected (selection, path));
 
   /* Nothing should be selected at this point. */
-  g_return_if_fail (gtk_tree_selection_count_selected_rows (selection) == 0);
+  g_assert_cmpint (gtk_tree_selection_count_selected_rows (selection), ==, 0);
 
   /* Check that selection really still works. */
   gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), path, NULL, FALSE);
-  g_return_if_fail (gtk_tree_selection_path_is_selected (selection, path) == TRUE);
-  g_return_if_fail (gtk_tree_selection_count_selected_rows (selection) == 1);
+  g_assert_true (gtk_tree_selection_path_is_selected (selection, path));
+  g_assert_cmpint (gtk_tree_selection_count_selected_rows (selection), ==, 1);
 
   /* Expand and select child node now. */
   gtk_tree_path_append_index (path, 1);
   gtk_tree_view_expand_all (GTK_TREE_VIEW (view));
 
   gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), path, NULL, FALSE);
-  g_return_if_fail (gtk_tree_selection_path_is_selected (selection, path) == TRUE);
-  g_return_if_fail (gtk_tree_selection_count_selected_rows (selection) == 1);
+  g_assert_true (gtk_tree_selection_path_is_selected (selection, path));
+  g_assert_cmpint (gtk_tree_selection_count_selected_rows (selection), ==, 1);
 
   gtk_tree_path_free (path);